<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = '1980-12-30 10:20:20';
      const d = new Date(str);
      console.log(d.toLocaleString());

      d.setFullYear(1981, 6, 20);
      d.setMonth(7, 21);
      d.setDate(20);

      d.setHours(18, 21, 22, 200);
      d.setMinutes(23, 40, 300);
      d.setSeconds(50, 1000);
      d.setMilliseconds(700);

      d.setTime(100);

      console.log(d.toLocaleString());
    </script>
  </body>
</html>
